home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / updates / update32.zoo / libg++ / src / diffs next >
Encoding:
Text File  |  1993-07-13  |  50.5 KB  |  2,254 lines

  1. *** 1.14    1993/05/29 21:16:07
  2. --- Changelo    1993/07/13 17:38:43
  3. ***************
  4. *** 313,315 ****
  5. --- 313,329 ----
  6.       sync up with libg++ 2.3.1
  7.   
  8.   ---------------------------- Patchlevel 19 -----------------------------------
  9. +     RENAME iodtoa.cc to floatcon.cc due to gnu renaming. sorry about the
  10. +     last patch, that tried to patch the wrong file.
  11. +  *.cc, *.h:: ++jrb
  12. +     sync up with libg++ 2.3.10
  13. +  *.cc, *.h:: ++jrb
  14. +     sync up with libg++ 2.3.91
  15. +  *.cc, *.h:: ++jrb
  16. +     sync up with libg++ 2.4.0
  17. + ---------------------------- Patchlevel 20 -----------------------------------
  18. *** 1.14    1993/05/29 21:16:07
  19. --- PatchLev.h    1993/07/13 17:38:44
  20. ***************
  21. *** 1,5 ****
  22.   
  23. ! #define    PatchLevel "19"
  24.   
  25.   /*
  26.    *    the Patch Level above is to identify the version
  27. --- 1,5 ----
  28.   
  29. ! #define    PatchLevel "20"
  30.   
  31.   /*
  32.    *    the Patch Level above is to identify the version
  33. *** 1.4    1992/06/03 02:12:17
  34. --- dtoa.cc    1993/07/13 17:38:46
  35. ***************
  36. *** 30,35 ****
  37. --- 30,36 ----
  38.   #define M_LN10        2.30258509299404568402
  39.   #endif
  40.   
  41. + #ifdef __GNUC__ /* cfront cannot compile this routine */
  42.   // OBSOLETE ROUTINE!
  43.   
  44.   char* dtoa(double fpnum,  char cvt, int width, int prec)
  45. ***************
  46. *** 336,339 ****
  47.     
  48.     return fmtbase;
  49.   }
  50. --- 337,340 ----
  51.     
  52.     return fmtbase;
  53.   }
  54. ! #endif
  55. *** 1.4    1993/02/05 04:59:04
  56. --- editbuf.cc    1993/07/13 17:38:46
  57. ***************
  58. *** 15,26 ****
  59.   //    License along with this library; if not, write to the Free
  60.   //    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  61.   
  62. - #include <ioprivat.h>
  63. - #include <editbuf.h>
  64. - #include <stddef.h>
  65.   #ifdef __GNUG__
  66.   #pragma implementation
  67.   #endif
  68.   
  69.   /* NOTE: Some of the code here is taken from GNU emacs */
  70.   /* Hence this file falls under the GNU License! */
  71. --- 15,26 ----
  72.   //    License along with this library; if not, write to the Free
  73.   //    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  74.   
  75.   #ifdef __GNUG__
  76.   #pragma implementation
  77.   #endif
  78. + #include <ioprivat.h>
  79. + #include <editbuf.h>
  80. + #include <stddef.h>
  81.   
  82.   /* NOTE: Some of the code here is taken from GNU emacs */
  83.   /* Hence this file falls under the GNU License! */
  84. *** 1.2    1992/06/03 02:12:17
  85. --- error.cc    1993/07/13 17:38:46
  86. ***************
  87. *** 21,26 ****
  88. --- 21,28 ----
  89.   #include <builtin.h>
  90.   #include <osfcn.h>
  91.   
  92. + extern "C" _VOLATILE_VOID abort();
  93.   _VOLATILE_VOID default_one_arg_error_handler(const char* msg)
  94.   {
  95.     fputs("Error: ", stderr);
  96. *** 1.11    1993/05/29 21:16:07
  97. --- filebuf.cc    1993/07/13 17:38:47
  98. ***************
  99. *** 342,349 ****
  100.       streampos delta = gptr() - egptr();
  101.       if (in_backup())
  102.           delta -= eGptr() - Gbase();
  103. !     if (sys_seek(delta, ios::cur) == EOF)
  104. !         return EOF;
  105.       }
  106.       // FIXME: Cleanup - can this be shared?
  107.   //    setg(base(), ptr, ptr);
  108. --- 342,352 ----
  109.       streampos delta = gptr() - egptr();
  110.       if (in_backup())
  111.           delta -= eGptr() - Gbase();
  112. !     _G_fpos_t new_pos = sys_seek(delta, ios::cur);
  113. !     if (new_pos == EOF)
  114. !       return EOF;
  115. !     _fb._offset = new_pos;
  116. !     setg(eback(), gptr(), gptr());
  117.       }
  118.       // FIXME: Cleanup - can this be shared?
  119.   //    setg(base(), ptr, ptr);
  120. *** 1.4    1993/01/17 03:34:31
  121. --- fstream.cc    1993/07/13 17:38:47
  122. ***************
  123. *** 15,26 ****
  124.   //    License along with this library; if not, write to the Free
  125.   //    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  126.   
  127. - #define _STREAM_COMPAT
  128. - #include <ioprivat.h>
  129. - #include <fstream.h>
  130.   #ifdef __GNUG__
  131.   #pragma implementation
  132.   #endif
  133.   
  134.   fstreambase::fstreambase()
  135.   {
  136. --- 15,26 ----
  137.   //    License along with this library; if not, write to the Free
  138.   //    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  139.   
  140.   #ifdef __GNUG__
  141.   #pragma implementation
  142.   #endif
  143. + #define _STREAM_COMPAT
  144. + #include <ioprivat.h>
  145. + #include <fstream.h>
  146.   
  147.   fstreambase::fstreambase()
  148.   {
  149. *** 1.5    1993/02/05 04:59:04
  150. --- igetline.cc    1993/07/13 17:38:48
  151. ***************
  152. *** 16,21 ****
  153. --- 16,22 ----
  154.   //    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  155.   
  156.   #include <iostream.h>
  157. + #include <string.h>
  158.   
  159.   istream& istream::getline(char* buf, _G_size_t len, char delim)
  160.   {
  161. *** 1.3    1993/02/05 04:59:04
  162. --- indstrea.cc    1993/07/13 17:38:48
  163. ***************
  164. *** 15,26 ****
  165.   //    License along with this library; if not, write to the Free
  166.   //    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  167.   
  168. - #include <indstrea.h>
  169.   #ifdef __GNUG__
  170.   #pragma implementation
  171.   #endif
  172.   
  173.   indirectbuf::indirectbuf(streambuf *get, streambuf *put, int delete_mode)
  174.   : streambuf()
  175.   {
  176. --- 15,26 ----
  177.   //    License along with this library; if not, write to the Free
  178.   //    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  179.   
  180.   #ifdef __GNUG__
  181.   #pragma implementation
  182.   #endif
  183.   
  184. + #include <indstrea.h>
  185.   indirectbuf::indirectbuf(streambuf *get, streambuf *put, int delete_mode)
  186.   : streambuf()
  187.   {
  188. *** 1.10    1993/02/05 04:59:04
  189. --- iostream.cc    1993/07/13 17:38:49
  190. ***************
  191. *** 50,61 ****
  192.   {
  193.       if (ipfx1()) {
  194.       int ch = _strbuf->sbumpc();
  195. !     if (ch == EOF) set(ios::eofbit|ios::failbit);
  196. !     else c = (char)ch;
  197.       }
  198.       return *this;
  199.   }
  200.   
  201.   istream& istream::ignore(_G_size_t n1 /* = 1 */, int delim /* = EOF */)
  202.   {
  203.       long n = n1;
  204. --- 50,79 ----
  205.   {
  206.       if (ipfx1()) {
  207.       int ch = _strbuf->sbumpc();
  208. !     if (ch == EOF) {
  209. !       set(ios::eofbit|ios::failbit);
  210. !       _gcount = 0;
  211. !     }
  212. !     else {
  213. !       c = (char)ch;
  214. !       _gcount = 1;
  215. !     }
  216.       }
  217.       return *this;
  218.   }
  219.   
  220. + int istream::peek()
  221. + {
  222. +   if (!good())
  223. +     return EOF;
  224. +   if (_tie && rdbuf()->in_avail() == 0)
  225. +     _tie->flush();
  226. +   int ch = _strbuf->sgetc();
  227. +   if (ch == EOF)
  228. +     set(ios::eofbit);
  229. +   return ch;
  230. + }
  231.   istream& istream::ignore(_G_size_t n1 /* = 1 */, int delim /* = EOF */)
  232.   {
  233.       long n = n1;
  234. ***************
  235. *** 151,186 ****
  236.   
  237.   istream& istream::operator>>(char* ptr)
  238.   {
  239. !     if (ipfx0()) {
  240. !     register streambuf* sb = _strbuf;
  241.       int ch = sb->sbumpc();
  242.       if (ch == EOF)
  243. !         set(ios::eofbit|ios::failbit);
  244. !     else {
  245. !         int w = width(0);
  246.           sb->sputbackc(ch);
  247. !         for (;;) {
  248. !         ch = sb->sbumpc();
  249. !         if (ch == EOF) {
  250. !             set(ios::eofbit);
  251. !             break;
  252. !         }
  253. !         else if (isspace(ch)) {
  254. !             sb->sputbackc(ch);
  255. !             break;
  256. !         }
  257. !         else if (w == 1) {
  258. !             set(ios::failbit);
  259. !             sb->sputbackc(ch);
  260. !             break;
  261. !         }
  262. !         else *ptr++ = ch;
  263. !         w--;
  264. !         }
  265. !     }
  266. !     }
  267. !     *ptr = '\0';
  268. !     return *this;
  269.   }
  270.   
  271.   #if defined(__GNUC__) && (!defined(atarist))
  272. --- 169,203 ----
  273.   
  274.   istream& istream::operator>>(char* ptr)
  275.   {
  276. !   register char *p = ptr;
  277. !   int w = width(0);
  278. !   if (ipfx0()) {
  279. !     register streambuf* sb = _strbuf;
  280. !     for (;;)
  281. !       {
  282.       int ch = sb->sbumpc();
  283.       if (ch == EOF)
  284. !       {
  285. !         set(p == ptr ? (ios::eofbit|ios::failbit) : (ios::eofbit));
  286. !         break;
  287. !       }
  288. !     else if (isspace(ch))
  289. !       {
  290.           sb->sputbackc(ch);
  291. !         break;
  292. !       }
  293. !     else if (w == 1)
  294. !       {
  295. !         set(ios::failbit);
  296. !         sb->sputbackc(ch);
  297. !         break;
  298. !       }
  299. !     else *p++ = ch;
  300. !     w--;
  301. !       }
  302. !   }
  303. !   *p = '\0';
  304. !   return *this;
  305.   }
  306.   
  307.   #if defined(__GNUC__) && (!defined(atarist))
  308. ***************
  309. *** 323,328 ****
  310. --- 340,350 ----
  311.   ostream& ostream::operator<<(char c)
  312.   {
  313.       if (opfx()) {
  314. + #if 1
  315. +     // This is what the cfront implementation does.
  316. +     _strbuf->sputc(c);
  317. + #else
  318. +     // This is what cfront documentation and current ANSI drafts say.
  319.       int w = width(0);
  320.       char fill_char = fill();
  321.       register int padding = w > 0 ? w - 1 : 0;
  322. ***************
  323. *** 332,337 ****
  324. --- 354,360 ----
  325.       sb->sputc(c);
  326.       if (flags() & ios::left) // Left adjustment.
  327.           while (--padding >= 0) sb->sputc(fill_char);
  328. + #endif
  329.       osfx();
  330.       }
  331.       return *this;
  332. ***************
  333. *** 355,366 ****
  334.       // Note that we use separate code for decimal, octal, and hex,
  335.       // so we can divide by optimizable constants.
  336.       if ((stream.flags() & ios::basefield) == ios::oct) { // Octal
  337. -     if ((stream.flags() & ios::showbase) && (val != 0))
  338. -         show_base = "0", show_base_len = 1;
  339.       do {
  340.           *--buf_ptr = (val & 7) + '0';
  341.           val = val >> 3;
  342.       } while (val != 0);
  343.       }
  344.       else if ((stream.flags() & ios::basefield) == ios::hex) { // Hex
  345.       char *xdigs = (stream.flags() & ios::uppercase) ? "0123456789ABCDEF0X"
  346. --- 378,389 ----
  347.       // Note that we use separate code for decimal, octal, and hex,
  348.       // so we can divide by optimizable constants.
  349.       if ((stream.flags() & ios::basefield) == ios::oct) { // Octal
  350.       do {
  351.           *--buf_ptr = (val & 7) + '0';
  352.           val = val >> 3;
  353.       } while (val != 0);
  354. +     if ((stream.flags() & ios::showbase) && (val != 0))
  355. +         *--buf_ptr = '0';
  356.       }
  357.       else if ((stream.flags() & ios::basefield) == ios::hex) { // Hex
  358.       char *xdigs = (stream.flags() & ios::uppercase) ? "0123456789ABCDEF0X"
  359. ***************
  360. *** 369,382 ****
  361.           *--buf_ptr = xdigs[val & 15];
  362.           val = val >> 4;
  363.       } while (val != 0);
  364. !     if (stream.flags() & ios::showbase) {
  365.           show_base = xdigs + 16; // Either "0X" or "0x".
  366.           show_base_len = 2;
  367.       }
  368.       }
  369.       else { // Decimal
  370. -     if (val != 0 && sign > 0 && (stream.flags() & ios::showpos))
  371. -         show_pos=1;
  372.   #ifdef __GNUC__
  373.       // Optimization:  Only use long long when we need to.
  374.       while (val > UINT_MAX) {
  375. --- 392,403 ----
  376.           *--buf_ptr = xdigs[val & 15];
  377.           val = val >> 4;
  378.       } while (val != 0);
  379. !     if ((stream.flags() & ios::showbase) && (val != 0)) {
  380.           show_base = xdigs + 16; // Either "0X" or "0x".
  381.           show_base_len = 2;
  382.       }
  383.       }
  384.       else { // Decimal
  385.   #ifdef __GNUC__
  386.       // Optimization:  Only use long long when we need to.
  387.       while (val > UINT_MAX) {
  388. ***************
  389. *** 392,397 ****
  390. --- 413,420 ----
  391.           *--buf_ptr = (ival % 10) + '0';
  392.           ival /= 10;
  393.       } while (ival != 0);
  394. +     if (sign > 0 && (stream.flags() & ios::showpos))
  395. +         show_pos=1;
  396.       }
  397.   
  398.       _G_size_t buf_len = buf+WRITE_BUF_SIZE - buf_ptr;
  399. ***************
  400. *** 501,517 ****
  401.   
  402.       int fpprec = 0; // 'Extra' (suppressed) floating precision.
  403.       int prec = precision();
  404. !     if (prec < 0) prec = 6; // default.
  405. !     else if (prec > MAXFRACT) {
  406.           if (flags() & (ios::fixed|ios::scientific) & ios::showpos)
  407.           fpprec = prec - MAXFRACT;
  408.           prec = MAXFRACT;
  409.       }
  410.   
  411.       // Do actual conversion.
  412.   #ifdef USE_DTOA
  413.       if (__outfloat(n, rdbuf(), format_char, width(0),
  414. !                precision(), flags(), 0, fill()) < 0)
  415.           set(ios::badbit|ios::failbit); // ??
  416.   #else
  417.       int negative;
  418. --- 524,541 ----
  419.   
  420.       int fpprec = 0; // 'Extra' (suppressed) floating precision.
  421.       int prec = precision();
  422. !     if (prec > MAXFRACT) {
  423.           if (flags() & (ios::fixed|ios::scientific) & ios::showpos)
  424.           fpprec = prec - MAXFRACT;
  425.           prec = MAXFRACT;
  426.       }
  427. +     else if (prec <= 0 && !(flags() & ios::fixed))
  428. +       prec = 6; /* default */
  429.   
  430.       // Do actual conversion.
  431.   #ifdef USE_DTOA
  432.       if (__outfloat(n, rdbuf(), format_char, width(0),
  433. !                prec, flags(), 0, fill()) < 0)
  434.           set(ios::badbit|ios::failbit); // ??
  435.   #else
  436.       int negative;
  437. ***************
  438. *** 519,525 ****
  439.       int sign = '\0';
  440.       char *cp = buf;
  441.       *cp = 0;
  442. !     int size = __cvt_double(n, precision(),
  443.                   flags() & ios::showpoint ? 0x80 : 0,
  444.                   &negative,
  445.                   format_char, cp, buf + sizeof(buf));
  446. --- 543,549 ----
  447.       int sign = '\0';
  448.       char *cp = buf;
  449.       *cp = 0;
  450. !     int size = __cvt_double(n, prec,
  451.                   flags() & ios::showpoint ? 0x80 : 0,
  452.                   &negative,
  453.                   format_char, cp, buf + sizeof(buf));
  454. ***************
  455. *** 581,587 ****
  456.       return *this;
  457.   }
  458.   
  459. ! ostream& ostream::operator<<(void *p)
  460.   {
  461.       if (opfx()) {
  462.       form("%p", p);
  463. --- 605,611 ----
  464.       return *this;
  465.   }
  466.   
  467. ! ostream& ostream::operator<<(const void *p)
  468.   {
  469.       if (opfx()) {
  470.       form("%p", p);
  471. ***************
  472. *** 664,671 ****
  473.   
  474.   ostream& flush(ostream& outs)
  475.   {
  476. !     outs.rdbuf()->overflow(EOF);
  477. !     return outs;
  478.   }
  479.   
  480.   istream& ws(istream& ins)
  481. --- 688,694 ----
  482.   
  483.   ostream& flush(ostream& outs)
  484.   {
  485. !   return outs.flush();
  486.   }
  487.   
  488.   istream& ws(istream& ins)
  489. ***************
  490. *** 699,705 ****
  491.   
  492.   ostream& ends(ostream& outs)
  493.   {
  494. !     outs.put(0);
  495.       return outs;
  496.   }
  497.   
  498. --- 722,728 ----
  499.   
  500.   ostream& ends(ostream& outs)
  501.   {
  502. !     outs.put('\0');
  503.       return outs;
  504.   }
  505.   
  506. *** 1.12    1993/03/29 03:53:00
  507. --- mincl    1993/07/13 17:38:50
  508. ***************
  509. *** 18,24 ****
  510.   IOSRC = editbuf.cc filebuf.cc fstream.cc igetline.cc indstrea.cc iostream.cc \
  511.   makebuf.cc parsestr.cc sbufvfor.cc sbufvsca.cc sgetline.cc stdstrbu.cc \
  512.   stdstrea.cc stream.cc streambu.cc strstrea.cc xplotfil.cc xsfile.cc \
  513. ! igetsb.cc iodtoa.cc outfloat.cc iomanip.cc stdiostr.cc
  514.   
  515.   OBJ = ident.o $(LIBSRC:.cc=.o) $(IOSRC:.cc=.o)
  516.   
  517. --- 18,24 ----
  518.   IOSRC = editbuf.cc filebuf.cc fstream.cc igetline.cc indstrea.cc iostream.cc \
  519.   makebuf.cc parsestr.cc sbufvfor.cc sbufvsca.cc sgetline.cc stdstrbu.cc \
  520.   stdstrea.cc stream.cc streambu.cc strstrea.cc xplotfil.cc xsfile.cc \
  521. ! igetsb.cc floatcon.cc outfloat.cc iomanip.cc stdiostr.cc
  522.   
  523.   OBJ = ident.o $(LIBSRC:.cc=.o) $(IOSRC:.cc=.o)
  524.   
  525. *** 1.5    1993/05/29 21:16:07
  526. --- outfloat.cc    1993/07/13 17:38:51
  527. ***************
  528. *** 49,69 ****
  529.         case 'f':
  530.       mode = 3;
  531.       break;
  532. -       case 'F':
  533. -     exp = 'e';
  534. -     mode = 0;
  535. -     skip_zeroes = 1;
  536. -     type = 'g';
  537. -     break;
  538.         case 'e':
  539. -     exp = 'e';
  540. -     mode = 2;
  541. -     precision++;  // Add one to include digit before decimal point.
  542. -     break;
  543.         case 'E':
  544. !     exp = 'E';
  545.       mode = 2;
  546. !     precision++;  // Add one to include digit before decimal point.
  547.       break;
  548.         case 'g':
  549.         case 'G':
  550. --- 49,60 ----
  551.         case 'f':
  552.       mode = 3;
  553.       break;
  554.         case 'e':
  555.         case 'E':
  556. !     exp = type;
  557.       mode = 2;
  558. !     if (precision != 999)
  559. !       precision++;  // Add one to include digit before decimal point.
  560.       break;
  561.         case 'g':
  562.         case 'G':
  563. ***************
  564. *** 76,85 ****
  565. --- 67,80 ----
  566.       break;
  567.       }
  568.       /* Do the actual convension */
  569. +     if (precision == 999 && mode != 3)
  570. +       mode = 0;
  571.       char *p = dtoa(value, mode, precision, &decpt, &sign, &end);
  572.       register int i;
  573.       int useful_digits = end-p;
  574.       char *exponent_start = EBUF_END;
  575. +     if (mode == 0)
  576. +       precision = useful_digits;
  577.       // Check if we need to emit an exponent.
  578.       if (mode != 3 && decpt != 9999) {
  579.       i = decpt - 1;
  580. *** 1.2    1993/02/05 04:59:04
  581. --- procbuf.cc    1993/07/13 17:38:51
  582. ***************
  583. *** 25,30 ****
  584. --- 25,31 ----
  585.   
  586.   #ifndef FORK
  587.   #define FORK vfork
  588. + extern "C" _G_pid_t vfork(void);
  589.   #endif
  590.   
  591.   procbuf::procbuf(const char *command, int mode) : filebuf()
  592. *** 1.8    1992/12/14 19:14:32
  593. --- regex.cc    1993/07/13 17:38:52
  594. ***************
  595. *** 31,36 ****
  596. --- 31,37 ----
  597.   #else
  598.   #ifdef sparc
  599.   #include <alloca.h>
  600. + extern "C" void *__builtin_alloca(...);
  601.   #else
  602.   #ifdef _AIX
  603.   #pragma alloca
  604. ***************
  605. *** 223,229 ****
  606.   
  607.   /* Store NUMBER in two contiguous bytes starting at DESTINATION.  */
  608.   #define STORE_NUMBER(destination, number)                \
  609. !   { (destination)[0] = (number) & 0377;                    \
  610.       (destination)[1] = (number) >> 8; }
  611.     
  612.   /* Same as STORE_NUMBER, except increment the destination pointer to
  613. --- 224,230 ----
  614.   
  615.   /* Store NUMBER in two contiguous bytes starting at DESTINATION.  */
  616.   #define STORE_NUMBER(destination, number)                \
  617. !   { (destination)[0] = (char)((number) & 0377);                \
  618.       (destination)[1] = (number) >> 8; }
  619.     
  620.   /* Same as STORE_NUMBER, except increment the destination pointer to
  621. ***************
  622. *** 2504,2510 ****
  623.             if (d >= string1 && d <= end1)
  624.           dend = end_match_1;
  625.             /* Restore register info.  */
  626. !           last_used_reg = (short) *--stackp;
  627.             
  628.             /* Make the ones that weren't saved -1 or 0 again.  */
  629.             for (this_reg = RE_NREGS - 1; this_reg > last_used_reg; this_reg--)
  630. --- 2505,2511 ----
  631.             if (d >= string1 && d <= end1)
  632.           dend = end_match_1;
  633.             /* Restore register info.  */
  634. !           last_used_reg = (short) (int) *--stackp;
  635.             
  636.             /* Make the ones that weren't saved -1 or 0 again.  */
  637.             for (this_reg = RE_NREGS - 1; this_reg > last_used_reg; this_reg--)
  638. ***************
  639. *** 2550,2556 ****
  640.   
  641.   /* Entry points compatible with 4.2 BSD regex library.  */
  642.   
  643. ! #ifndef emacs
  644.   
  645.   static struct re_pattern_buffer re_comp_buf;
  646.   
  647. --- 2551,2557 ----
  648.   
  649.   /* Entry points compatible with 4.2 BSD regex library.  */
  650.   
  651. ! #if 0
  652.   
  653.   static struct re_pattern_buffer re_comp_buf;
  654.   
  655. *** 1.6    1993/01/17 03:34:31
  656. --- sbufvsca.cc    1993/07/13 17:38:52
  657. ***************
  658. *** 97,103 ****
  659.       int nread;        /* number of characters consumed from fp */
  660.       // Assignments to base and ccfn are just to suppress warnings from gcc.
  661.       int base = 0;        /* base argument to strtol/strtoul */
  662. !     u_long (*ccfn)(const char*, char**, int) = 0;
  663.       // conversion function (strtol/strtoul)
  664.       char ccltab[256];    /* character class table for %[...] */
  665.       char buf[BUF];        /* buffer for numeric conversions */
  666. --- 97,104 ----
  667.       int nread;        /* number of characters consumed from fp */
  668.       // Assignments to base and ccfn are just to suppress warnings from gcc.
  669.       int base = 0;        /* base argument to strtol/strtoul */
  670. !     typedef u_long (*strtoulfn)(const char*, char**, int);
  671. !     strtoulfn ccfn = 0;
  672.       // conversion function (strtol/strtoul)
  673.       char ccltab[256];    /* character class table for %[...] */
  674.       char buf[BUF];        /* buffer for numeric conversions */
  675. ***************
  676. *** 178,190 ****
  677.               /* FALLTHROUGH */
  678.           case 'd':
  679.               c = CT_INT;
  680. !             ccfn = (u_long (*)(const char, char**, int))strtol;
  681.               base = 10;
  682.               break;
  683.   
  684.           case 'i':
  685.               c = CT_INT;
  686. !             ccfn = (u_long (*)(const char, char**, int))strtol;
  687.               base = 0;
  688.               break;
  689.   
  690. --- 179,191 ----
  691.               /* FALLTHROUGH */
  692.           case 'd':
  693.               c = CT_INT;
  694. !             ccfn = (strtoulfn)strtol;
  695.               base = 10;
  696.               break;
  697.   
  698.           case 'i':
  699.               c = CT_INT;
  700. !             ccfn = (strtoulfn)strtol;
  701.               base = 0;
  702.               break;
  703.   
  704. ***************
  705. *** 203,211 ****
  706.               base = 10;
  707.               break;
  708.   
  709. !         case 'X':    /* compat   XXX */
  710. !             flags |= LONG;
  711. !             /* FALLTHROUGH */
  712.           case 'x':
  713.               flags |= PFXOK;    /* enable 0x prefixing */
  714.               c = CT_INT;
  715. --- 204,210 ----
  716.               base = 10;
  717.               break;
  718.   
  719. !         case 'X':
  720.           case 'x':
  721.               flags |= PFXOK;    /* enable 0x prefixing */
  722.               c = CT_INT;
  723. ***************
  724. *** 214,223 ****
  725.               break;
  726.   
  727.   #ifdef FLOATING_POINT
  728. !         case 'E':    /* compat   XXX */
  729. !         case 'F':    /* compat */
  730. !             flags |= LONG;
  731. !             /* FALLTHROUGH */
  732.           case 'e': case 'f': case 'g':
  733.               c = CT_FLOAT;
  734.               break;
  735. --- 213,219 ----
  736.               break;
  737.   
  738.   #ifdef FLOATING_POINT
  739. !         case 'E': case 'F':
  740.           case 'e': case 'f': case 'g':
  741.               c = CT_FLOAT;
  742.               break;
  743. ***************
  744. *** 267,273 ****
  745.               if (isupper(c))
  746.                   flags |= LONG;
  747.               c = CT_INT;
  748. !             ccfn = (u_long (*)(const char, char**, int))strtol;
  749.               base = 10;
  750.               break;
  751.           }
  752. --- 263,269 ----
  753.               if (isupper(c))
  754.                   flags |= LONG;
  755.               c = CT_INT;
  756. !             ccfn = (strtoulfn)strtol;
  757.               base = 10;
  758.               break;
  759.           }
  760. ***************
  761. *** 283,289 ****
  762.            * that suppress this.
  763.            */
  764.           if ((flags & NOSKIP) == 0) {
  765. !             n = *_gptr;
  766.               while (isspace(n)) {
  767.               _gptr++;
  768.               nread++;
  769. --- 279,285 ----
  770.            * that suppress this.
  771.            */
  772.           if ((flags & NOSKIP) == 0) {
  773. !             n = (unsigned char)*_gptr;
  774.               while (isspace(n)) {
  775.               _gptr++;
  776.               nread++;
  777. ***************
  778. *** 343,349 ****
  779.               /* take only those things in the class */
  780.               if (flags & SUPPRESS) {
  781.                   n = 0;
  782. !                 while (ccltab[*_gptr]) {
  783.                       n++, _gptr++;
  784.                       if (--width == 0)
  785.                       break;
  786. --- 339,345 ----
  787.               /* take only those things in the class */
  788.               if (flags & SUPPRESS) {
  789.                   n = 0;
  790. !                 while (ccltab[(unsigned char)*_gptr]) {
  791.                       n++, _gptr++;
  792.                       if (--width == 0)
  793.                       break;
  794. ***************
  795. *** 358,364 ****
  796.                       goto match_failure;
  797.               } else {
  798.                   p0 = p = va_arg(ap, char *);
  799. !                 while (ccltab[*_gptr]) {
  800.                   *p++ = *_gptr++;
  801.                   if (--width == 0)
  802.                       break;
  803. --- 354,360 ----
  804.                       goto match_failure;
  805.               } else {
  806.                   p0 = p = va_arg(ap, char *);
  807. !                 while (ccltab[(unsigned char)*_gptr]) {
  808.                   *p++ = *_gptr++;
  809.                   if (--width == 0)
  810.                       break;
  811. ***************
  812. *** 384,390 ****
  813.                   width = ~0;
  814.               if (flags & SUPPRESS) {
  815.                   n = 0;
  816. !                 while (!isspace(*_gptr)) {
  817.                       n++, _gptr++;
  818.                       if (--width == 0)
  819.                           break;
  820. --- 380,386 ----
  821.                   width = ~0;
  822.               if (flags & SUPPRESS) {
  823.                   n = 0;
  824. !                 while (!isspace((unsigned char)*_gptr)) {
  825.                       n++, _gptr++;
  826.                       if (--width == 0)
  827.                           break;
  828. ***************
  829. *** 396,402 ****
  830.                   nread += n;
  831.               } else {
  832.                   p0 = p = va_arg(ap, char *);
  833. !                 while (!isspace(*_gptr)) {
  834.                       *p++ = *_gptr++;
  835.                       if (--width == 0)
  836.                           break;
  837. --- 392,398 ----
  838.                   nread += n;
  839.               } else {
  840.                   p0 = p = va_arg(ap, char *);
  841. !                 while (!isspace((unsigned char)*_gptr)) {
  842.                       *p++ = *_gptr++;
  843.                       if (--width == 0)
  844.                           break;
  845. ***************
  846. *** 417,423 ****
  847.                   width = sizeof(buf) - 1;
  848.               flags |= SIGNOK | NDIGITS | NZDIGITS;
  849.               for (p = buf; width; width--) {
  850. !                 c = *_gptr;
  851.                   /*
  852.                    * Switch on the character; `goto ok'
  853.                    * if we accept it as a part of number.
  854. --- 413,419 ----
  855.                   width = sizeof(buf) - 1;
  856.               flags |= SIGNOK | NDIGITS | NZDIGITS;
  857.               for (p = buf; width; width--) {
  858. !                 c = (unsigned char)*_gptr;
  859.                   /*
  860.                    * Switch on the character; `goto ok'
  861.                    * if we accept it as a part of number.
  862. ***************
  863. *** 548,554 ****
  864.                   width = sizeof(buf) - 1;
  865.               flags |= SIGNOK | NDIGITS | DPTOK | EXPOK;
  866.               for (p = buf; width; width--) {
  867. !                 c = *_gptr;
  868.                   /*
  869.                    * This code mimicks the integer conversion
  870.                    * code, but is much simpler.
  871. --- 544,550 ----
  872.                   width = sizeof(buf) - 1;
  873.               flags |= SIGNOK | NDIGITS | DPTOK | EXPOK;
  874.               for (p = buf; width; width--) {
  875. !                 c = (unsigned char)*_gptr;
  876.                   /*
  877.                    * This code mimicks the integer conversion
  878.                    * code, but is much simpler.
  879. *** 1.2    1993/02/05 04:59:04
  880. --- stdiostr.cc    1993/07/13 17:38:53
  881. ***************
  882. *** 57,65 ****
  883.   
  884.   _G_ssize_t stdiobuf::sys_write(const void *buf, _G_size_t n)
  885.   {
  886. !     return fwrite(buf, 1, n, _file);
  887.       if (_fb._offset >= 0)
  888.       _fb._offset += n;
  889.   }
  890.   
  891.   _G_fpos_t stdiobuf::sys_seek(_G_fpos_t offset, _seek_dir dir)
  892. --- 57,66 ----
  893.   
  894.   _G_ssize_t stdiobuf::sys_write(const void *buf, _G_size_t n)
  895.   {
  896. !     _G_ssize_t count = fwrite(buf, 1, n, _file);
  897.       if (_fb._offset >= 0)
  898.       _fb._offset += n;
  899. +     return count;
  900.   }
  901.   
  902.   _G_fpos_t stdiobuf::sys_seek(_G_fpos_t offset, _seek_dir dir)
  903. *** 1.6    1993/02/05 04:59:04
  904. --- stdstrbu.cc    1993/07/13 17:38:53
  905. ***************
  906. *** 70,80 ****
  907.        0, 0, 0, 0, 0, 0, 0, 0, CHAIN, 0, 0, 0, 0, 0}
  908.   
  909.   #define DEF_FILEBUF(NAME, FD, CHAIN, FLAGS) \
  910. !   _fake_filebuf NAME[1] = {{FILEBUF_LITERAL(CHAIN, FLAGS), vt_filebuf, {FD}}};
  911.   
  912.   DEF_FILEBUF(__std_filebuf_0, 0, 0, _S_NO_WRITES);
  913. ! DEF_FILEBUF(__std_filebuf_1, 1, (streambuf*)__std_filebuf_0, _S_NO_READS);
  914. ! DEF_FILEBUF(__std_filebuf_2, 2, (streambuf*)__std_filebuf_1,
  915.           _S_NO_READS+_S_UNBUFFERED);
  916.   
  917.   // Nest define the stdiobuf-bases objects.
  918. --- 70,80 ----
  919.        0, 0, 0, 0, 0, 0, 0, 0, CHAIN, 0, 0, 0, 0, 0}
  920.   
  921.   #define DEF_FILEBUF(NAME, FD, CHAIN, FLAGS) \
  922. !   _fake_filebuf NAME = {FILEBUF_LITERAL(CHAIN, FLAGS), vt_filebuf, {FD}};
  923.   
  924.   DEF_FILEBUF(__std_filebuf_0, 0, 0, _S_NO_WRITES);
  925. ! DEF_FILEBUF(__std_filebuf_1, 1, (streambuf*)&__std_filebuf_0, _S_NO_READS);
  926. ! DEF_FILEBUF(__std_filebuf_2, 2, (streambuf*)&__std_filebuf_1,
  927.           _S_NO_READS+_S_UNBUFFERED);
  928.   
  929.   // Nest define the stdiobuf-bases objects.
  930. ***************
  931. *** 82,88 ****
  932.   #if !defined(vt_stdiobuf)
  933.   #ifndef __GNUG__
  934.   // This works for cfront.
  935. ! #define vt_stdiobuf __vtbl__7stdiobuf
  936.   extern char vt_stdiobuf[1];
  937.   #elif _G_DOLLAR_IN_LABEL
  938.   extern char vt_stdiobuf[1] asm(UNDERSCORE "_vt$stdiobuf");
  939. --- 82,88 ----
  940.   #if !defined(vt_stdiobuf)
  941.   #ifndef __GNUG__
  942.   // This works for cfront.
  943. ! #define vt_stdiobuf __vtbl__8stdiobuf
  944.   extern char vt_stdiobuf[1];
  945.   #elif _G_DOLLAR_IN_LABEL
  946.   extern char vt_stdiobuf[1] asm(UNDERSCORE "_vt$stdiobuf");
  947. ***************
  948. *** 103,109 ****
  949.        FILEBUF_LITERAL(CHAIN, (FLAGS)|_S_UNBUFFERED),\
  950.        vt_stdiobuf, {FD}, FILE}};
  951.   
  952. ! DEF_STDIOBUF(__stdin_stdiobuf, stdin, 0, (streambuf*)__std_filebuf_2,
  953.            _S_NO_WRITES);
  954.   DEF_STDIOBUF(__stdout_stdiobuf, stdout, 1, (streambuf*)__stdin_stdiobuf,
  955.            _S_NO_READS);
  956. --- 103,109 ----
  957.        FILEBUF_LITERAL(CHAIN, (FLAGS)|_S_UNBUFFERED),\
  958.        vt_stdiobuf, {FD}, FILE}};
  959.   
  960. ! DEF_STDIOBUF(__stdin_stdiobuf, stdin, 0, (streambuf*)&__std_filebuf_2,
  961.            _S_NO_WRITES);
  962.   DEF_STDIOBUF(__stdout_stdiobuf, stdout, 1, (streambuf*)__stdin_stdiobuf,
  963.            _S_NO_READS);
  964. *** 1.5    1993/01/17 03:34:31
  965. --- stdstrea.cc    1993/07/13 17:38:53
  966. ***************
  967. *** 63,83 ****
  968.   #undef cerr
  969.   #undef clog
  970.   
  971. ! #ifdef __GNUG__
  972.   #define PAD 0 /* g++ allows 0-length arrays. */
  973.   #else
  974.   #define PAD 1
  975.   #endif
  976.   struct _fake_istream {
  977.       struct myfields {
  978.       _ios_fields *vb; /* pointer to virtual base class ios */
  979.       _G_ssize_t _gcount;
  980.       } mine;
  981.       _ios_fields base;
  982.       char filler[sizeof(struct istream)-sizeof(struct _ios_fields)+PAD];
  983.   };
  984.   struct _fake_ostream {
  985.       struct myfields {
  986.       _ios_fields *vb; /* pointer to virtual base class ios */
  987.       } mine;
  988.       _ios_fields base;
  989. --- 63,93 ----
  990.   #undef cerr
  991.   #undef clog
  992.   
  993. ! #ifdef __GNUC__
  994.   #define PAD 0 /* g++ allows 0-length arrays. */
  995.   #else
  996.   #define PAD 1
  997.   #endif
  998.   struct _fake_istream {
  999.       struct myfields {
  1000. + #ifdef __GNUC__
  1001.       _ios_fields *vb; /* pointer to virtual base class ios */
  1002.       _G_ssize_t _gcount;
  1003. + #else
  1004. +     /* This is supposedly correct for cfront. */
  1005. +     _G_ssize_t _gcount;
  1006. +     void *vptr;
  1007. +     _ios_fields *vb; /* pointer to virtual base class ios */
  1008. + #endif
  1009.       } mine;
  1010.       _ios_fields base;
  1011.       char filler[sizeof(struct istream)-sizeof(struct _ios_fields)+PAD];
  1012.   };
  1013.   struct _fake_ostream {
  1014.       struct myfields {
  1015. + #ifndef __GNUC__
  1016. +     void *vptr;
  1017. + #endif
  1018.       _ios_fields *vb; /* pointer to virtual base class ios */
  1019.       } mine;
  1020.       _ios_fields base;
  1021. ***************
  1022. *** 87,101 ****
  1023.   #define STD_STR(SBUF, TIE, EXTRA_FLAGS) \
  1024.    (streambuf*)&SBUF, TIE, 0, ios::dont_close|ios::skipws|EXTRA_FLAGS, ' ',0,0,6
  1025.   
  1026. ! #define STREAM_DEF(TYPE, NAME, SBUF, TIE, EXTRA_FLAGS) \
  1027.     TYPE NAME = { {&NAME.base}, {STD_STR(SBUF, TIE, EXTRA_FLAGS) }};
  1028.   
  1029. ! STREAM_DEF(_fake_ostream, cout, COUT_SBUF, NULL, 0)
  1030. ! STREAM_DEF(_fake_ostream, cerr, CERR_SBUF, (ostream*)&cout, ios::unitbuf)
  1031. ! STREAM_DEF(_fake_istream, cin, CIN_SBUF,  (ostream*)&cout, 0)
  1032.   
  1033.   /* Only for (partial) compatibility with AT&T's library. */
  1034. ! STREAM_DEF(_fake_ostream, clog, CERR_SBUF, (ostream*)&cout, 0)
  1035.   
  1036.   // Switches between using __std_filebuf_{0,1,2} and
  1037.   // __std{in,out,err}_stdiobuf for standard streams.  This is
  1038. --- 97,120 ----
  1039.   #define STD_STR(SBUF, TIE, EXTRA_FLAGS) \
  1040.    (streambuf*)&SBUF, TIE, 0, ios::dont_close|ios::skipws|EXTRA_FLAGS, ' ',0,0,6
  1041.   
  1042. ! #ifdef __GNUC__
  1043. ! #define OSTREAM_DEF(TYPE, NAME, SBUF, TIE, EXTRA_FLAGS) \
  1044. !   TYPE NAME = { {&NAME.base}, {STD_STR(SBUF, TIE, EXTRA_FLAGS) }};
  1045. ! #define ISTREAM_DEF(TYPE, NAME, SBUF, TIE, EXTRA_FLAGS) \
  1046.     TYPE NAME = { {&NAME.base}, {STD_STR(SBUF, TIE, EXTRA_FLAGS) }};
  1047. + #else
  1048. + #define OSTREAM_DEF(TYPE, NAME, SBUF, TIE, EXTRA_FLAGS) \
  1049. +   TYPE NAME = { {0, &NAME.base}, {STD_STR(SBUF, TIE, EXTRA_FLAGS) }};
  1050. + #define ISTREAM_DEF(TYPE, NAME, SBUF, TIE, EXTRA_FLAGS) \
  1051. +   TYPE NAME = { {0, 0, &NAME.base}, {STD_STR(SBUF, TIE, EXTRA_FLAGS) }};
  1052. + #endif
  1053.   
  1054. ! OSTREAM_DEF(_fake_ostream, cout, COUT_SBUF, NULL, 0)
  1055. ! OSTREAM_DEF(_fake_ostream, cerr, CERR_SBUF, (ostream*)&cout, ios::unitbuf)
  1056. ! ISTREAM_DEF(_fake_istream, cin, CIN_SBUF,  (ostream*)&cout, 0)
  1057.   
  1058.   /* Only for (partial) compatibility with AT&T's library. */
  1059. ! OSTREAM_DEF(_fake_ostream, clog, CERR_SBUF, (ostream*)&cout, 0)
  1060.   
  1061.   // Switches between using __std_filebuf_{0,1,2} and
  1062.   // __std{in,out,err}_stdiobuf for standard streams.  This is
  1063. *** 1.8    1993/02/05 04:59:04
  1064. --- strstrea.cc    1993/07/13 17:38:54
  1065. ***************
  1066. *** 172,177 ****
  1067. --- 172,183 ----
  1068.       _len = egptr() - ptr;
  1069.   }
  1070.   
  1071. + void strstreambuf::init_static (const char *ptr, long size)
  1072. + {
  1073. +   init_static((char*)ptr, size, NULL);
  1074. +   xsetflags(_S_NO_WRITES);
  1075. + }
  1076.   strstreambuf::~strstreambuf()
  1077.   {
  1078.       if (_base && !(_flags & _S_USER_BUF))
  1079. ***************
  1080. *** 182,189 ****
  1081.   streampos strstreambuf::seekoff(streamoff off, _seek_dir dir,
  1082.                       int mode /*=ios::in|ios::out*/)
  1083.   {
  1084. -     _allocate_buffer = default_alloc;
  1085. -     _free_buffer = default_free;
  1086.       size_t cur_size = pcount();
  1087.       streampos new_pos = EOF;
  1088.   
  1089. --- 188,193 ----
  1090. *** 1.7    1992/12/14 19:14:32
  1091. --- xbitset.cc    1993/07/13 17:38:55
  1092. ***************
  1093. *** 687,693 ****
  1094.     }
  1095.   }
  1096.   
  1097. ! int BitSet::previous(int p, int b) const
  1098.   {
  1099.     if (--p < 0)
  1100.       return -1;
  1101. --- 687,693 ----
  1102.     }
  1103.   }
  1104.   
  1105. ! int BitSet::prev(int p, int b) const
  1106.   {
  1107.     if (--p < 0)
  1108.       return -1;
  1109. ***************
  1110. *** 770,776 ****
  1111.     if (b == rep->virt)
  1112.       return -1;
  1113.     else
  1114. !     return previous((rep->len) * BITSETBITS, b);
  1115.   }
  1116.   
  1117.   
  1118. --- 770,776 ----
  1119.     if (b == rep->virt)
  1120.       return -1;
  1121.     else
  1122. !     return prev((rep->len) * BITSETBITS, b);
  1123.   }
  1124.   
  1125.   
  1126. ***************
  1127. *** 938,948 ****
  1128.     return s;
  1129.   }
  1130.   
  1131. ! void BitSet::printon(ostream& s, char f, char t, char star) const
  1132.   // FIXME:  Does not respect s.width()!
  1133.   {
  1134.     trim(rep);
  1135. !   register streambuf* sb = s.rdbuf();
  1136.     const unsigned short* s = rep->s;
  1137.     const unsigned short* top = &(s[rep->len - 1]);
  1138.   
  1139. --- 938,948 ----
  1140.     return s;
  1141.   }
  1142.   
  1143. ! void BitSet::printon(ostream& os, char f, char t, char star) const
  1144.   // FIXME:  Does not respect s.width()!
  1145.   {
  1146.     trim(rep);
  1147. !   register streambuf* sb = os.rdbuf();
  1148.     const unsigned short* s = rep->s;
  1149.     const unsigned short* top = &(s[rep->len - 1]);
  1150.   
  1151. *** 1.7    1992/12/14 19:14:32
  1152. --- xbitstri.cc    1993/07/13 17:38:55
  1153. ***************
  1154. *** 978,984 ****
  1155.     }
  1156.   }
  1157.   
  1158. ! int BitString::previous(int p, unsigned int b) const
  1159.   {
  1160.     if (--p < 0)
  1161.       return -1;
  1162. --- 978,984 ----
  1163.     }
  1164.   }
  1165.   
  1166. ! int BitString::prev(int p, unsigned int b) const
  1167.   {
  1168.     if (--p < 0)
  1169.       return -1;
  1170. *** 1.2    1992/11/08 00:19:13
  1171. --- xcomplex.cc    1993/07/13 17:38:56
  1172. ***************
  1173. *** 220,226 ****
  1174.   #else
  1175.     if (!s.ipfx(0))
  1176.     {
  1177. !     s.set(ios::failbit); // Redundant if using GNU iostreams.
  1178.       return s;
  1179.     }
  1180.   #endif
  1181. --- 220,226 ----
  1182.   #else
  1183.     if (!s.ipfx(0))
  1184.     {
  1185. !     s.clear(ios::failbit|s.rdstate()); // Redundant if using GNU iostreams.
  1186.       return s;
  1187.     }
  1188.   #endif
  1189. ***************
  1190. *** 242,248 ****
  1191.       else
  1192.         i = 0;
  1193.       if (ch != ')')
  1194. !       s.clear(_fail);
  1195.     }
  1196.     else
  1197.     {
  1198. --- 242,248 ----
  1199.       else
  1200.         i = 0;
  1201.       if (ch != ')')
  1202. !       s.clear(ios::failbit);
  1203.     }
  1204.     else
  1205.     {
  1206. *** 1.5    1992/12/14 19:14:32
  1207. --- xcursesw.cc    1993/07/13 17:38:56
  1208. ***************
  1209. *** 23,29 ****
  1210.   #include <values.h>
  1211.   #ifndef _OLD_STREAMS
  1212.   #include <strstream.h>
  1213. ! #include <ioprivate.h>
  1214.   #endif
  1215.   // Include CurseW.h and/or curses.h *after* iostream includes,
  1216.   // because curses.h defines a clear macro that conflicts with iostream. Sigh.
  1217. --- 23,29 ----
  1218.   #include <values.h>
  1219.   #ifndef _OLD_STREAMS
  1220.   #include <strstream.h>
  1221. ! //#include <ioprivate.h>
  1222.   #endif
  1223.   // Include CurseW.h and/or curses.h *after* iostream includes,
  1224.   // because curses.h defines a clear macro that conflicts with iostream. Sigh.
  1225. ***************
  1226. *** 38,43 ****
  1227. --- 38,61 ----
  1228.    *
  1229.    */
  1230.   
  1231. + #if !defined(_IO_MAGIC) && !defined(HAVE_VSCANF) &&!defined vsscanf
  1232. + extern "C" int _doscan(FILE *, const char*, va_list args);
  1233. + static int vsscanf(char *buf, const char * fmt, va_list args)
  1234. + {
  1235. +   FILE b;
  1236. + #ifdef _IOSTRG
  1237. +   b._flag = _IOREAD|_IOSTRG;
  1238. + #else
  1239. +   b._flag = _IOREAD;
  1240. + #endif
  1241. +   b._base = (unsigned char*)buf;
  1242. +   b._ptr = (unsigned char*)buf;
  1243. +   b._cnt = BUFSIZ;
  1244. +   return _doscan(&b, fmt, args);
  1245. + }
  1246. + #endif
  1247.   /*
  1248.    * varargs functions are handled conservatively:
  1249.    * They interface directly into the underlying 
  1250. ***************
  1251. *** 55,75 ****
  1252.     char buf[BUFSIZ];
  1253.     int result = wgetstr(w, buf);
  1254.     if (result == OK) {
  1255. ! #ifndef _OLD_STREAMS
  1256.       strstreambuf ss(buf, BUFSIZ);
  1257.       result = ss.vscan(fmt, args);
  1258. ! #else /* _OLD_STREAMS */
  1259. ! #ifndef HAVE_VSCANF
  1260. !       FILE b;
  1261. !       b._flag = _IOREAD|_IOSTRG;
  1262. !       b._base = buf;
  1263. !       b._ptr = buf;
  1264. !       b._cnt = BUFSIZ;
  1265. !       result = _doscan(&b, fmt, args);
  1266. ! #else /* HAVE_VSCANF */
  1267. !       result = vsscanf(buf, fmt, args);
  1268. ! #endif /* HAVE_VSCANF */
  1269. ! #endif /* _OLD_STREAMS */
  1270.     }
  1271.   #endif /* !VMS */
  1272.     va_end(args);
  1273. --- 73,85 ----
  1274.     char buf[BUFSIZ];
  1275.     int result = wgetstr(w, buf);
  1276.     if (result == OK) {
  1277. ! #ifdef _IO_MAGIC /* GNU iostreams */
  1278.       strstreambuf ss(buf, BUFSIZ);
  1279.       result = ss.vscan(fmt, args);
  1280. ! #else
  1281. !     result = vsscanf(buf, fmt, args);
  1282. ! #endif
  1283.     }
  1284.   #endif /* !VMS */
  1285.     va_end(args);
  1286. ***************
  1287. *** 89,109 ****
  1288.    {
  1289.       result = wgetstr(w, buf);
  1290.       if (result == OK) {
  1291. ! #ifndef _OLD_STREAMS
  1292.       strstreambuf ss(buf, BUFSIZ);
  1293.       result = ss.vscan(fmt, args);
  1294. - #else /* OLD_STREAMS */
  1295. - #ifndef HAVE_VSCANF
  1296. -     FILE b;
  1297. -     b._flag = _IOREAD|_IOSTRG;
  1298. -     b._base = buf;
  1299. -     b._ptr = buf;
  1300. -     b._cnt = BUFSIZ;
  1301. -     result = _doscan(&b, fmt, args);
  1302.   #else
  1303. !     result = vsscanf(buf, fmt, args);
  1304.   #endif
  1305. - #endif /* OLD_STREAMS */
  1306.     }
  1307.     }
  1308.   #endif /* !VMS */
  1309. --- 99,110 ----
  1310.    {
  1311.       result = wgetstr(w, buf);
  1312.       if (result == OK) {
  1313. ! #ifdef _IO_MAGIC /* GNU iostreams */
  1314.       strstreambuf ss(buf, BUFSIZ);
  1315.       result = ss.vscan(fmt, args);
  1316.   #else
  1317. !     result = vsscanf(buf, fmt, args);
  1318.   #endif
  1319.     }
  1320.     }
  1321.   #endif /* !VMS */
  1322. ***************
  1323. *** 116,137 ****
  1324.     va_list args;
  1325.     va_start(args, fmt);
  1326.     char buf[BUFSIZ];
  1327. - #ifndef _OLD_STREAMS
  1328. -   strstreambuf ss(buf, BUFSIZ);
  1329. -   ss.vform(fmt, args);
  1330. -   ss.sputc(0);
  1331. - #else /* _OLD_STREAMS */
  1332. - #ifndef HAVE_VPRINTF
  1333. -   FILE b;
  1334. -   b._flag = _IOWRT|_IOSTRG;
  1335. -   b._ptr = buf;
  1336. -   b._cnt = BUFSIZ;
  1337. -   _doprnt(fmt, args, &b);
  1338. -   putc('\0', &b);
  1339. - #else
  1340.     vsprintf(buf, fmt, args);
  1341. - #endif
  1342. - #endif /* _OLD_STREAMS */
  1343.     va_end(args);
  1344.     return waddstr(w, buf);
  1345.   }
  1346. --- 117,123 ----
  1347. ***************
  1348. *** 145,166 ****
  1349.     if (result == OK)
  1350.     {
  1351.       char buf[BUFSIZ];
  1352. - #ifndef _OLD_STREAMS
  1353. -     strstreambuf ss(buf, BUFSIZ);
  1354. -     ss.vform(fmt, args);
  1355. -     ss.sputc(0);
  1356. - #else /* _OLD_STREAMS */
  1357. - #ifndef HAVE_VPRINTF
  1358. -     FILE b;
  1359. -     b._flag = _IOWRT|_IOSTRG;
  1360. -     b._ptr = buf;
  1361. -     b._cnt = BUFSIZ;
  1362. -     _doprnt(fmt, args, &b);
  1363. -     putc('\0', &b);
  1364. - #else
  1365.       vsprintf(buf, fmt, args);
  1366. - #endif
  1367. - #endif /* _OLD_STREAMS */
  1368.       result = waddstr(w, buf);
  1369.     }
  1370.     va_end(args);
  1371. --- 131,137 ----
  1372. *** 1.6    1992/12/14 19:14:32
  1373. --- xfix.cc    1993/07/13 17:38:57
  1374. ***************
  1375. *** 101,107 ****
  1376.     return _new_Fix(len);
  1377.   }
  1378.   
  1379. ! _Fix new_Fix(uint16 len, _Fix x)
  1380.   {
  1381.     _Fix z = _new_Fix(len);
  1382.     return copy(x,z);
  1383. --- 101,107 ----
  1384.     return _new_Fix(len);
  1385.   }
  1386.   
  1387. ! _Fix new_Fix(uint16 len, const _Fix x)
  1388.   {
  1389.     _Fix z = _new_Fix(len);
  1390.     return copy(x,z);
  1391. ***************
  1392. *** 139,145 ****
  1393.   
  1394.   // convert to a double 
  1395.   
  1396. ! double value(Fix& x)
  1397.   { 
  1398.     double d = 0.0;
  1399.     for ( int i=x.rep->siz-1; i >= 0; i-- )
  1400. --- 139,145 ----
  1401.   
  1402.   // convert to a double 
  1403.   
  1404. ! double value(const Fix& x)
  1405.   { 
  1406.     double d = 0.0;
  1407.     for ( int i=x.rep->siz-1; i >= 0; i-- )
  1408. ***************
  1409. *** 158,164 ****
  1410.     Integer a = 1, b=1;
  1411.     for ( int i=0; i < x.rep->siz; i++ )
  1412.     {
  1413. !     a = (a << 16) + x.rep->s[i];
  1414.       b <<= 16;
  1415.     }
  1416.     return a-b;
  1417. --- 158,165 ----
  1418.     Integer a = 1, b=1;
  1419.     for ( int i=0; i < x.rep->siz; i++ )
  1420.     {
  1421. !     a <<= 16;
  1422. !     a += x.rep->s[i];
  1423.       b <<= 16;
  1424.     }
  1425.     return a-b;
  1426. ***************
  1427. *** 181,187 ****
  1428.     return 0;
  1429.   }
  1430.   
  1431. ! int compare(_Fix x, _Fix y)
  1432.   {
  1433.     if ( x->siz == y->siz )
  1434.       return docmp(x->s, y->s, x->siz);
  1435. --- 182,188 ----
  1436.     return 0;
  1437.   }
  1438.   
  1439. ! int compare(const _Fix x, const _Fix y)
  1440.   {
  1441.     if ( x->siz == y->siz )
  1442.       return docmp(x->s, y->s, x->siz);
  1443. ***************
  1444. *** 292,298 ****
  1445.       b += r->s[k];
  1446.           r->s[k] = b;
  1447.         }
  1448. !       if ( k < r->siz + 1 )
  1449.           carry = (a >> 15) + (b >> 16);
  1450.       }
  1451.       r->s[i] = carry;
  1452. --- 293,299 ----
  1453.       b += r->s[k];
  1454.           r->s[k] = b;
  1455.         }
  1456. !       if ( k < (int)r->siz + 1 )
  1457.           carry = (a >> 15) + (b >> 16);
  1458.       }
  1459.       r->s[i] = carry;
  1460. ***************
  1461. *** 452,463 ****
  1462.   
  1463.   extern AllocRing _libgxx_fmtq;
  1464.   
  1465. ! void Fix::printon(ostream& s, int width)
  1466.   {
  1467.     char format[20];
  1468.     double val = value(*this);
  1469.     int old_precision = s.precision(width-3);
  1470. !   ios::fmtflags old_flags = s.setf(ios::fixed, ios::fixed|ios::scientific);
  1471.     if (val >= 0)
  1472.         s << ' ';
  1473.     s.width(width-2);
  1474. --- 453,464 ----
  1475.   
  1476.   extern AllocRing _libgxx_fmtq;
  1477.   
  1478. ! void Fix::printon(ostream& s, int width) const
  1479.   {
  1480.     char format[20];
  1481.     double val = value(*this);
  1482.     int old_precision = s.precision(width-3);
  1483. !   long old_flags = s.setf(ios::fixed, ios::fixed|ios::scientific);
  1484.     if (val >= 0)
  1485.         s << ' ';
  1486.     s.width(width-2);
  1487. ***************
  1488. *** 487,511 ****
  1489.   istream& operator >> (istream& s, Fix& y)
  1490.   {
  1491.     int got_one = 0;
  1492. - #ifdef _OLD_STREAMS
  1493. -   if (!s.good())
  1494. -   {
  1495. -     return s;
  1496. -   }
  1497. - #else
  1498.     if (!s.ipfx(0))
  1499.     {
  1500. !     s.set(ios::failbit); // Redundant if using GNU iostreams.
  1501.       return s;
  1502.     }
  1503. - #endif
  1504.   
  1505.     char sign = 0, point = 0;
  1506.     char ch;
  1507.     s >> ws;
  1508.     if (!s.good())
  1509.     {
  1510. !     s.set(_fail);
  1511.       return s;
  1512.     }
  1513.     while (s.get(ch))
  1514. --- 488,505 ----
  1515.   istream& operator >> (istream& s, Fix& y)
  1516.   {
  1517.     int got_one = 0;
  1518.     if (!s.ipfx(0))
  1519.     {
  1520. !     s.clear(ios::failbit|s.rdstate()); // Redundant if using GNU iostreams.
  1521.       return s;
  1522.     }
  1523.   
  1524.     char sign = 0, point = 0;
  1525.     char ch;
  1526.     s >> ws;
  1527.     if (!s.good())
  1528.     {
  1529. !     s.clear(ios::failbit|s.rdstate());
  1530.       return s;
  1531.     }
  1532.     while (s.get(ch))
  1533. ***************
  1534. *** 542,548 ****
  1535.     if (s.good())
  1536.       s.putback(ch);
  1537.     if (!got_one)
  1538. !     s.set(_fail);
  1539.     else
  1540.       y = atoF(p);
  1541.     _libgxx_io_ob.free(p);
  1542. --- 536,542 ----
  1543.     if (s.good())
  1544.       s.putback(ch);
  1545.     if (!got_one)
  1546. !     s.clear(ios::failbit|s.rdstate());
  1547.     else
  1548.       y = atoF(p);
  1549.     _libgxx_io_ob.free(p);
  1550. ***************
  1551. *** 596,619 ****
  1552.     else
  1553.     {
  1554.       r->s[0] = 0x7fff;
  1555. !     for ( int i=1; i < r->siz; i++ )
  1556.         r->s[i] = 0xffff;
  1557.       mask(r);
  1558.     }
  1559.   }
  1560.   
  1561. ! void Fix_overflow_wrap(_Fix& r) {}
  1562.   
  1563.   void Fix_overflow_warning_saturate(_Fix& r) {
  1564.     Fix_overflow_warning(r);
  1565.     Fix_overflow_saturate(r);
  1566.   }
  1567.   
  1568. ! void Fix_overflow_warning(_Fix& r) {
  1569.     cerr << "Fix: overflow warning\n"; 
  1570.   }
  1571.   
  1572. ! void Fix_overflow_error(_Fix& r) {
  1573.     cerr << "Fix: overflow error\n"; 
  1574.     abort();
  1575.   }
  1576. --- 590,613 ----
  1577.     else
  1578.     {
  1579.       r->s[0] = 0x7fff;
  1580. !     for ( int i = 1; i < (int)r->siz; i++ )
  1581.         r->s[i] = 0xffff;
  1582.       mask(r);
  1583.     }
  1584.   }
  1585.   
  1586. ! void Fix_overflow_wrap(_Fix&) {}
  1587.   
  1588.   void Fix_overflow_warning_saturate(_Fix& r) {
  1589.     Fix_overflow_warning(r);
  1590.     Fix_overflow_saturate(r);
  1591.   }
  1592.   
  1593. ! void Fix_overflow_warning(_Fix&) {
  1594.     cerr << "Fix: overflow warning\n"; 
  1595.   }
  1596.   
  1597. ! void Fix_overflow_error(_Fix&) {
  1598.     cerr << "Fix: overflow error\n"; 
  1599.     abort();
  1600.   }
  1601. *** 1.1    1992/03/22 07:42:32
  1602. --- xfix16.cc    1993/07/13 17:38:57
  1603. ***************
  1604. *** 69,75 ****
  1605.   }
  1606.   
  1607.   
  1608. ! Fix32 operator * (Fix32& a, Fix32& b)
  1609.   {
  1610.   // break a and b into lo and hi parts, and do a multiple-precision
  1611.   // multiply, with rounding
  1612. --- 69,75 ----
  1613.   }
  1614.   
  1615.   
  1616. ! Fix32 operator * (const Fix32& a, const Fix32& b)
  1617.   {
  1618.   // break a and b into lo and hi parts, and do a multiple-precision
  1619.   // multiply, with rounding
  1620. ***************
  1621. *** 92,98 ****
  1622.     return Fix32(p);
  1623.   }
  1624.   
  1625. ! Fix16 operator / (Fix16& a, Fix16& b)
  1626.   {
  1627.     short q;
  1628.     int apos = (a.m >= 0);
  1629. --- 92,98 ----
  1630.     return Fix32(p);
  1631.   }
  1632.   
  1633. ! Fix16 operator / (const Fix16& a, const Fix16& b)
  1634.   {
  1635.     short q;
  1636.     int apos = (a.m >= 0);
  1637. ***************
  1638. *** 114,120 ****
  1639.     return Fix16(q);
  1640.   }
  1641.   
  1642. ! Fix32 operator / (Fix32& a, Fix32& b)
  1643.   {
  1644.     long q;
  1645.     int apos = (a.m >= 0);
  1646. --- 114,120 ----
  1647.     return Fix16(q);
  1648.   }
  1649.   
  1650. ! Fix32 operator / (const Fix32& a, const Fix32& b)
  1651.   {
  1652.     long q;
  1653.     int apos = (a.m >= 0);
  1654. ***************
  1655. *** 150,171 ****
  1656.   
  1657.   // error handling
  1658.   
  1659. ! void Fix16::overflow(short& i)
  1660.   {
  1661.     (*Fix16_overflow_handler)(i);
  1662.   }
  1663.   
  1664. ! void Fix32::overflow(long& i)
  1665.   {
  1666.     (*Fix32_overflow_handler)(i);
  1667.   }
  1668.   
  1669. ! void Fix16::range_error(short& i)
  1670.   {
  1671.     (*Fix16_range_error_handler)(i);
  1672.   }
  1673.   
  1674. ! void Fix32::range_error(long& i)
  1675.   {
  1676.     (*Fix32_range_error_handler)(i);
  1677.   }
  1678. --- 150,171 ----
  1679.   
  1680.   // error handling
  1681.   
  1682. ! void Fix16::overflow(short& i) const
  1683.   {
  1684.     (*Fix16_overflow_handler)(i);
  1685.   }
  1686.   
  1687. ! void Fix32::overflow(long& i) const
  1688.   {
  1689.     (*Fix32_overflow_handler)(i);
  1690.   }
  1691.   
  1692. ! void Fix16::range_error(short& i) const
  1693.   {
  1694.     (*Fix16_range_error_handler)(i);
  1695.   }
  1696.   
  1697. ! void Fix32::range_error(long& i) const
  1698.   {
  1699.     (*Fix32_range_error_handler)(i);
  1700.   }
  1701. *** 1.3    1992/06/03 02:12:17
  1702. --- xfix24.cc    1993/07/13 17:38:57
  1703. ***************
  1704. *** 86,92 ****
  1705.   }
  1706.   
  1707.   
  1708. ! Fix48 operator * (Fix24& a, Fix24& b)
  1709.   {
  1710.   // break a and b into lo and hi parts, and do a multiple-precision
  1711.   // multiply, with rounding
  1712. --- 86,92 ----
  1713.   }
  1714.   
  1715.   
  1716. ! Fix48 operator * (const Fix24& a, const Fix24& b)
  1717.   {
  1718.   // break a and b into lo and hi parts, and do a multiple-precision
  1719.   // multiply, with rounding
  1720. ***************
  1721. *** 120,126 ****
  1722.     return r;
  1723.   }
  1724.   
  1725. ! Fix24 operator / (Fix24& a, Fix24& b)
  1726.   {
  1727.     long q;
  1728.     int apos = (a.m >= 0);
  1729. --- 120,126 ----
  1730.     return r;
  1731.   }
  1732.   
  1733. ! Fix24 operator / (const Fix24& a, const Fix24& b)
  1734.   {
  1735.     long q;
  1736.     int apos = (a.m >= 0);
  1737. ***************
  1738. *** 151,161 ****
  1739.       q += 0x80;            // Round result to 24 bits
  1740.       if (apos != bpos) q = -q;    // Fix sign
  1741.     }
  1742. !   return (q & 0xffffff00);
  1743.   }
  1744.   
  1745.   
  1746. ! Fix48 operator + (Fix48&  f, Fix48&  g)
  1747.   {
  1748.     long lo_r = (f.m.l >> 8) + (g.m.l >> 8);
  1749.     twolongs r;
  1750. --- 151,161 ----
  1751.       q += 0x80;            // Round result to 24 bits
  1752.       if (apos != bpos) q = -q;    // Fix sign
  1753.     }
  1754. !   return (q & ~0xFF);
  1755.   }
  1756.   
  1757.   
  1758. ! Fix48 operator + (const Fix48&  f, const Fix48&  g)
  1759.   {
  1760.     long lo_r = (f.m.l >> 8) + (g.m.l >> 8);
  1761.     twolongs r;
  1762. ***************
  1763. *** 167,173 ****
  1764.     return r;
  1765.   }
  1766.   
  1767. ! Fix48 operator - (Fix48&  f, Fix48&  g)
  1768.   {
  1769.     unsigned lo_r = (f.m.l >> 8) - (g.m.l >> 8);
  1770.     twolongs r;
  1771. --- 167,173 ----
  1772.     return r;
  1773.   }
  1774.   
  1775. ! Fix48 operator - (const Fix48&  f, const Fix48&  g)
  1776.   {
  1777.     unsigned lo_r = (f.m.l >> 8) - (g.m.l >> 8);
  1778.     twolongs r;
  1779. ***************
  1780. *** 179,185 ****
  1781.     return r;
  1782.   }
  1783.   
  1784. ! Fix48 operator * (Fix48& a, long b)
  1785.   {
  1786.     twolongs r;
  1787.     int bpos = (b >= 0);
  1788. --- 179,185 ----
  1789.     return r;
  1790.   }
  1791.   
  1792. ! Fix48 operator * (const Fix48& a, long b)
  1793.   {
  1794.     twolongs r;
  1795.     int bpos = (b >= 0);
  1796. ***************
  1797. *** 204,212 ****
  1798.     return r;
  1799.   }
  1800.   
  1801. ! Fix48 operator << (Fix48& a, int b)
  1802.   {
  1803. !   twolongs r; r.u = r.l = 0;
  1804.     if ( b >= 0 )
  1805.       if ( b < 24 ) {
  1806.         r.u = (a.m.u << b) + ((a.m.l >> (24 - b)) & 0xffffff00L);
  1807. --- 204,212 ----
  1808.     return r;
  1809.   }
  1810.   
  1811. ! Fix48 operator << (const Fix48& a, int b)
  1812.   {
  1813. !   twolongs r; r.u = 0; r.l = 0;
  1814.     if ( b >= 0 )
  1815.       if ( b < 24 ) {
  1816.         r.u = (a.m.u << b) + ((a.m.l >> (24 - b)) & 0xffffff00L);
  1817. ***************
  1818. *** 218,226 ****
  1819.     return r;
  1820.   }
  1821.   
  1822. ! Fix48 operator >> (Fix48& a, int b)
  1823.   {
  1824. !   twolongs r; r.u = r.l = 0;
  1825.     if ( b >= 0 )
  1826.       if ( b < 24 ) {
  1827.         r.l = (a.m.u << (24 - b)) + ((a.m.l >> b) & 0xffffff00L);
  1828. --- 218,226 ----
  1829.     return r;
  1830.   }
  1831.   
  1832. ! Fix48 operator >> (const Fix48& a, int b)
  1833.   {
  1834. !   twolongs r; r.u = 0; r.l = 0;
  1835.     if ( b >= 0 )
  1836.       if ( b < 24 ) {
  1837.         r.l = (a.m.u << (24 - b)) + ((a.m.l >> b) & 0xffffff00L);
  1838. ***************
  1839. *** 239,260 ****
  1840.   
  1841.   // error handling
  1842.   
  1843. ! void Fix24::overflow(long& i)
  1844.   {
  1845.     (*Fix24_overflow_handler)(i);
  1846.   }
  1847.   
  1848. ! void Fix48::overflow(twolongs& i)
  1849.   {
  1850.     (*Fix48_overflow_handler)(i);
  1851.   }
  1852.   
  1853. ! void Fix24::range_error(long& i)
  1854.   {
  1855.     (*Fix24_range_error_handler)(i);
  1856.   }
  1857.   
  1858. ! void Fix48::range_error(twolongs& i)
  1859.   {
  1860.     (*Fix48_range_error_handler)(i);
  1861.   }
  1862. --- 239,260 ----
  1863.   
  1864.   // error handling
  1865.   
  1866. ! void Fix24::overflow(long& i) const
  1867.   {
  1868.     (*Fix24_overflow_handler)(i);
  1869.   }
  1870.   
  1871. ! void Fix48::overflow(twolongs& i) const
  1872.   {
  1873.     (*Fix48_overflow_handler)(i);
  1874.   }
  1875.   
  1876. ! void Fix24::range_error(long& i) const
  1877.   {
  1878.     (*Fix24_range_error_handler)(i);
  1879.   }
  1880.   
  1881. ! void Fix48::range_error(twolongs& i) const
  1882.   {
  1883.     (*Fix48_range_error_handler)(i);
  1884.   }
  1885. *** 1.3    1992/12/14 19:14:32
  1886. --- xgetopt.cc    1993/07/13 17:38:58
  1887. ***************
  1888. *** 24,29 ****
  1889. --- 24,30 ----
  1890.   #define alloca __builtin_alloca
  1891.   #elif defined(sparc)
  1892.   #include <alloca.h>
  1893. + extern "C" void *__builtin_alloca(...);
  1894.   #elif defined(_AIX)
  1895.   #pragma alloca
  1896.   #else
  1897. *** 1.9    1993/05/29 21:16:07
  1898. --- xinteger.cc    1993/07/13 17:38:58
  1899. ***************
  1900. *** 468,474 ****
  1901.   {
  1902.     Integer q, r;
  1903.     divide(num, den, q, r);
  1904. !   double d1 = double(q);
  1905.    
  1906.     if (d1 >= DBL_MAX || d1 <= -DBL_MAX || sign(r) == 0)
  1907.       return d1;
  1908. --- 468,474 ----
  1909.   {
  1910.     Integer q, r;
  1911.     divide(num, den, q, r);
  1912. !   double d1 = q.as_double();
  1913.    
  1914.     if (d1 >= DBL_MAX || d1 <= -DBL_MAX || sign(r) == 0)
  1915.       return d1;
  1916. ***************
  1917. *** 1822,1834 ****
  1918.     {
  1919.       int bw = (unsigned long)b / I_SHIFT;
  1920.       int sw = (unsigned long)b % I_SHIFT;
  1921. !     if (x.rep == 0)
  1922. !       x.rep = Icalloc(0, bw + 1);
  1923. !     else if (x.rep->len < bw)
  1924. !     {
  1925. !       int xl = x.rep->len;
  1926.         x.rep = Iresize(x.rep, calc_len(xl, bw+1, 0));
  1927. -     }
  1928.       x.rep->s[bw] |= (1 << sw);
  1929.       Icheck(x.rep);
  1930.     }
  1931. --- 1822,1830 ----
  1932.     {
  1933.       int bw = (unsigned long)b / I_SHIFT;
  1934.       int sw = (unsigned long)b % I_SHIFT;
  1935. !     int xl = x.rep ? x.rep->len : 0;
  1936. !     if (xl <= bw)
  1937.         x.rep = Iresize(x.rep, calc_len(xl, bw+1, 0));
  1938.       x.rep->s[bw] |= (1 << sw);
  1939.       Icheck(x.rep);
  1940.     }
  1941. ***************
  1942. *** 1837,1853 ****
  1943.   void clearbit(Integer& x, long b)
  1944.   {
  1945.     if (b >= 0)
  1946. -   {
  1947. -     int bw = (unsigned long)b / I_SHIFT;
  1948. -     int sw = (unsigned long)b % I_SHIFT;
  1949. -     if (x.rep == 0)
  1950. -       x.rep = Icalloc(0, bw + 1);
  1951. -     else if (x.rep->len < bw)
  1952.       {
  1953. !       int xl = x.rep->len;
  1954. !       x.rep = Iresize(x.rep, calc_len(xl, bw+1, 0));
  1955. !     }
  1956. !     x.rep->s[bw] &= ~(1 << sw);
  1957.       Icheck(x.rep);
  1958.     }
  1959.   }
  1960. --- 1833,1848 ----
  1961.   void clearbit(Integer& x, long b)
  1962.   {
  1963.     if (b >= 0)
  1964.       {
  1965. !       if (x.rep == 0)
  1966. !     x.rep = &_ZeroRep;
  1967. !       else
  1968. !     {
  1969. !       int bw = (unsigned long)b / I_SHIFT;
  1970. !       int sw = (unsigned long)b % I_SHIFT;
  1971. !       if (x.rep->len > bw)
  1972. !         x.rep->s[bw] &= ~(1 << sw);
  1973. !     }
  1974.       Icheck(x.rep);
  1975.     }
  1976.   }
  1977. ***************
  1978. *** 2308,2321 ****
  1979.   #else
  1980.     if (!s.ipfx(0))
  1981.     {
  1982. !     s.set(ios::failbit);
  1983.       return s;
  1984.     }
  1985.   #endif
  1986.     s >> ws;
  1987.     if (!s.good())
  1988.     {
  1989. !     s.set(ios::failbit);
  1990.       return s;
  1991.     }
  1992.     
  1993. --- 2303,2316 ----
  1994.   #else
  1995.     if (!s.ipfx(0))
  1996.     {
  1997. !     s.clear(ios::failbit|s.rdstate());
  1998.       return s;
  1999.     }
  2000.   #endif
  2001.     s >> ws;
  2002.     if (!s.good())
  2003.     {
  2004. !     s.clear(ios::failbit|s.rdstate());
  2005.       return s;
  2006.     }
  2007.     
  2008. ***************
  2009. *** 2395,2401 ****
  2010.     if (s.good())
  2011.       s.putback(ch);
  2012.     if (!got_one)
  2013. !     s.set(ios::failbit);
  2014.   
  2015.     if (sgn == '-')
  2016.       y.negate();
  2017. --- 2390,2396 ----
  2018.     if (s.good())
  2019.       s.putback(ch);
  2020.     if (!got_one)
  2021. !     s.clear(ios::failbit|s.rdstate());
  2022.   
  2023.     if (sgn == '-')
  2024.       y.negate();
  2025. *** 1.5    1993/05/29 21:16:07
  2026. --- xrationa.cc    1993/07/13 17:39:00
  2027. ***************
  2028. *** 188,194 ****
  2029.   
  2030.   Rational pow(const Rational& x, const Integer& y)
  2031.   {
  2032. !   long yy = long(y);
  2033.     return pow(x, yy);
  2034.   }               
  2035.   
  2036. --- 188,194 ----
  2037.   
  2038.   Rational pow(const Rational& x, const Integer& y)
  2039.   {
  2040. !   long yy = y.as_long();
  2041.     return pow(x, yy);
  2042.   }               
  2043.   
  2044. ***************
  2045. *** 346,352 ****
  2046.   
  2047.   ostream& operator << (ostream& s, const Rational& y)
  2048.   {
  2049. !   if (y.denominator() == 1)
  2050.       s << y.numerator();
  2051.     else
  2052.     {
  2053. --- 346,352 ----
  2054.   
  2055.   ostream& operator << (ostream& s, const Rational& y)
  2056.   {
  2057. !   if (y.denominator() == 1L)
  2058.       s << y.numerator();
  2059.     else
  2060.     {
  2061. ***************
  2062. *** 367,373 ****
  2063.   #else
  2064.     if (!s.ipfx(0))
  2065.     {
  2066. !     s.set(ios::failbit); // Redundant if using GNU iostreams.
  2067.       return s;
  2068.     }
  2069.   #endif
  2070. --- 367,373 ----
  2071.   #else
  2072.     if (!s.ipfx(0))
  2073.     {
  2074. !     s.clear(ios::failbit|s.rdstate()); // Redundant if using GNU iostreams.
  2075.       return s;
  2076.     }
  2077.   #endif
  2078. ***************
  2079. *** 405,415 ****
  2080.   int
  2081.   Rational::fits_in_float() const
  2082.   {
  2083. !     return FLT_MIN <= *this && *this <= FLT_MAX;
  2084.   }
  2085.   
  2086.   int
  2087.   Rational::fits_in_double() const
  2088.   {
  2089. !     return DBL_MIN <= *this && *this <= DBL_MAX;
  2090.   }
  2091. --- 405,415 ----
  2092.   int
  2093.   Rational::fits_in_float() const
  2094.   {
  2095. !     return Rational (FLT_MIN) <= *this && *this <= Rational (FLT_MAX);
  2096.   }
  2097.   
  2098.   int
  2099.   Rational::fits_in_double() const
  2100.   {
  2101. !     return Rational (DBL_MIN) <= *this && *this <= Rational (DBL_MAX);
  2102.   }
  2103. *** 1.3    1992/12/14 19:14:32
  2104. --- xregex.cc    1993/07/13 17:39:00
  2105. ***************
  2106. *** 28,36 ****
  2107.   #include <new.h>
  2108.   #include <builtin.h>
  2109.   
  2110. ! // extern "C" {
  2111.   #include <regex.h>
  2112. ! // }
  2113.   
  2114.   #include <xregex.h>
  2115.   
  2116. --- 28,36 ----
  2117.   #include <new.h>
  2118.   #include <builtin.h>
  2119.   
  2120. ! extern "C" {
  2121.   #include <regex.h>
  2122. ! }
  2123.   
  2124.   #include <xregex.h>
  2125.   
  2126. *** 1.4    1992/11/08 00:19:13
  2127. --- xstring.cc    1993/07/13 17:39:02
  2128. ***************
  2129. *** 1201,1223 ****
  2130.   
  2131.   istream& operator>>(istream& s, String& x)
  2132.   {
  2133. - #ifdef _OLD_STREAMS
  2134. -   if (!s.good())
  2135. -   {
  2136. -     return s;
  2137. -   }
  2138. -   s >> ws;
  2139. -   if (!s.good())
  2140. -   {
  2141. -     return s;
  2142. -   }
  2143. - #else
  2144.     if (!s.ipfx(0) || (!(s.flags() & ios::skipws) && !ws(s)))
  2145.     {
  2146. !     s.set(ios::failbit); // Redundant if using GNU iostreams.
  2147.       return s;
  2148.     }
  2149. - #endif
  2150.     int ch;
  2151.     int i = 0;
  2152.     x.rep = Sresize(x.rep, 20);
  2153. --- 1201,1211 ----
  2154.   
  2155.   istream& operator>>(istream& s, String& x)
  2156.   {
  2157.     if (!s.ipfx(0) || (!(s.flags() & ios::skipws) && !ws(s)))
  2158.     {
  2159. !     s.clear(ios::failbit|s.rdstate()); // Redundant if using GNU iostreams.
  2160.       return s;
  2161.     }
  2162.     int ch;
  2163.     int i = 0;
  2164.     x.rep = Sresize(x.rep, 20);
  2165. ***************
  2166. *** 1232,1252 ****
  2167.     }
  2168.     x.rep->s[i] = 0;
  2169.     x.rep->len = i;
  2170. !   if (i == 0) s.set(_fail);
  2171. !   if (ch == EOF) s.set(_eof);
  2172.     return s;
  2173.   }
  2174.   
  2175.   int readline(istream& s, String& x, char terminator, int discard)
  2176.   {
  2177. - #ifdef _OLD_STREAMS
  2178. -   if (!s.good())
  2179. - #else
  2180.     if (!s.ipfx(0))
  2181. - #endif
  2182. -   {
  2183.       return 0;
  2184. -   }
  2185.     int ch;
  2186.     int i = 0;
  2187.     x.rep = Sresize(x.rep, 80);
  2188. --- 1220,1236 ----
  2189.     }
  2190.     x.rep->s[i] = 0;
  2191.     x.rep->len = i;
  2192. !   int new_state = s.rdstate();
  2193. !   if (i == 0) new_state |= ios::failbit;
  2194. !   if (ch == EOF) new_state |= ios::eofbit;
  2195. !   s.clear(new_state);
  2196.     return s;
  2197.   }
  2198.   
  2199.   int readline(istream& s, String& x, char terminator, int discard)
  2200.   {
  2201.     if (!s.ipfx(0))
  2202.       return 0;
  2203.     int ch;
  2204.     int i = 0;
  2205.     x.rep = Sresize(x.rep, 80);
  2206. ***************
  2207. *** 1264,1270 ****
  2208.     }
  2209.     x.rep->s[i] = 0;
  2210.     x.rep->len = i;
  2211. !   if (ch == EOF) s.set(_eof);
  2212.     return i;
  2213.   }
  2214.   
  2215. --- 1248,1254 ----
  2216.     }
  2217.     x.rep->s[i] = 0;
  2218.     x.rep->len = i;
  2219. !   if (ch == EOF) s.clear(ios::eofbit|s.rdstate());
  2220.     return i;
  2221.   }
  2222.   
  2223. ***************
  2224. *** 1324,1330 ****
  2225.   
  2226.   int SubString::OK() const
  2227.   {
  2228. !   int v = S != 0;               // have a String;
  2229.     v &= S.OK();                 // that is legal
  2230.     v &= pos + len >= S.rep->len;// pos and len within bounds
  2231.     if (!v) S.error("SubString invariant failure");
  2232. --- 1308,1314 ----
  2233.   
  2234.   int SubString::OK() const
  2235.   {
  2236. !   int v = S != (const char*)0; // have a String;
  2237.     v &= S.OK();                 // that is legal
  2238.     v &= pos + len >= S.rep->len;// pos and len within bounds
  2239.     if (!v) S.error("SubString invariant failure");
  2240.